package ren.kane.asdppp.transaction.change.affiliation;

import ren.kane.asdppp.affiliation.Affiliation;
import ren.kane.asdppp.Employee;
import ren.kane.asdppp.transaction.change.ChangeEmployeeTransaction;

/**
 * @author renrk(1275) on 2019-04-20 10:16 PM
 **/
public abstract class ChangeAffiliationTransaction extends ChangeEmployeeTransaction {

    public ChangeAffiliationTransaction() {
    }

    public ChangeAffiliationTransaction(int empId) {
        super(empId);
    }

    @Override
    protected void change(Employee employee) {
        employee.setAffiliation(getAffiliation());
        recordMemberShip(employee);
    }

    protected abstract Affiliation getAffiliation();

    protected abstract void recordMemberShip(Employee employee);
}
